﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FXSStation.Modules.SharedInfrastructureModule.BusinessClasses.Currency;
using FXSStation.Modules.SharedInfrastructureModule.BusinessClasses.Chart;
using FXSStation.Modules.SharedInfrastructureModule.BusinessClasses.Accounts;
using System.ComponentModel;

namespace FXSStation.Modules.SharedInfrastructureModule.BusinessClasses.Common
{
    public class Simulation : INotifyPropertyChanged
    {
        private SimulationMode _simulationMode;
        private CurrencyEnum _currencyPair;
        private TickFrequency _tickFrequency;
        private Account _account;

        public CurrencyEnum CurrencyPair
        {
            get { return _currencyPair; }
            set
            {
                _currencyPair = value;
                RaisePropertyChanged("CurrencyPair");
            }
        }
        public TickFrequency TickFrequency
        {
            get { return _tickFrequency; }
            set
            {
                _tickFrequency = value;
                RaisePropertyChanged("TickFrequency");
            }
        }
        public Account Account
        {
            get { return _account; }
            set { _account = value; }
        }
        public SimulationMode SimulationMode
        {
            get { return _simulationMode; }
            set { _simulationMode = value; }
        }

        public Simulation(SimulationMode mode, CurrencyEnum currency, TickFrequency frequency, Account account)
        {
            this._simulationMode = mode;
            this._tickFrequency = frequency;
            this._currencyPair = currency;
            this._account = account;
        }

        #region INotifyPropertyChanged values

        public event PropertyChangedEventHandler PropertyChanged;

        protected void RaisePropertyChanged(string propertyName)
        {
            var handler = PropertyChanged;
            if (handler != null)
            {
                handler(this, new PropertyChangedEventArgs(propertyName));
            }
        }
        #endregion
    }
}
